class Solution {
public:
    vector<string> sortPeople(vector<string>& names, vector<int>& heights) {
        int n=names.size();
        vector<int> id(n);
        for(int i=0;i<n;++i) 
            id[i]=i;
        sort(id.begin(),id.end(),[&](int a,int b){
            return heights[a]>heights[b];
        });
        vector<string> ret;
        for(int ch: id)
        {
            ret.push_back(names[ch]);
        }
        return ret;
    }
};
